home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World 2009 February
/
PCWFEB09.iso
/
Software
/
Linux
/
Kubuntu 8.10
/
kubuntu-8.10-desktop-i386.iso
/
casper
/
filesystem.squashfs
/
var
/
lib
/
dpkg
/
info
/
vim-tiny.prerm
< prev
next >
Wrap
Text File
|
2008-07-21
|
2KB
|
70 lines
#!/bin/bash -e
pkg=vim-tiny
variant=tiny
# two things to do:
# 1) remove /usr/bin/vim.variant as alternative for /usr/bin/vim
# 2) remove /usr/bin/gvim as an alternative for gnome-text-editor for
# variants built with gnome support
# check_and_remove_alternative cleans up stale alternatives that were left
# behind from previous mishandling of alternatives.
check_and_remove_alternative () {
if update-alternatives --list $1 | grep -q bin/vim; then
for f in `update-alternatives --list $1 | grep 'bin/vim$'`; do
update-alternatives --remove $1 $f
done
fi
}
remove_gnome_alternative () {
if [ -f /usr/bin/vim.$variant ]; then
check_and_remove_alternative gnome-text-editor
update-alternatives --remove gnome-text-editor /usr/bin/vim.$variant
fi
}
remove_variant_alternative () {
for i in vi view ex editor rvim rview vimdiff vim; do
check_and_remove_alternative $i
update-alternatives --remove $i /usr/bin/vim.$variant
done
case "$variant" in
gtk|lesstif|gnome) # gui enabled variants
remove_gui_variant_alternative
;;
esac
}
remove_gui_variant_alternative () {
for i in eview evim gview gvimdiff rgview rgvim gvim; do
check_and_remove_alternative $i
update-alternatives --remove $i /usr/bin/vim.$variant
done
}
case "$1" in
# only remove in remove/deconfigure so we don't disrupt users' preferences
remove|deconfigure)
case "$pkg" in
vim-gnome) # gnome enabled variants
remove_gnome_alternative
;;
esac
remove_variant_alternative
;;
upgrade|failed-upgrade)
;;
*)
echo "prerm called with unknown argument \`$1'" >&2
exit 0
;;
esac
exit 0